home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / Tools / Preditor 2.0 / Macros / NextMPWError < prev    next >
Encoding:
Text File  |  1991-08-26  |  2.0 KB  |  63 lines  |  [TEXT/TCEd]

  1. #
  2. #  NextMPWError
  3. #
  4. #  Last Modified: Tuesday, July 23, 1991 at 11:46 PM
  5. #
  6. #  Reads the MPW Worksheet file to find and process each error in the last
  7. #  compile.  Repeatedly running the macro will open and select each error.
  8. #  YOU MUST SAVE THE WORKSHEET FILE BEFORE YOU RUN THIS MACRO IF YOU WANT
  9. #  TO PICK UP THE LATEST COMPILATION ERRORS.  Also, make sure the current
  10. #  directory (the Open window directory) is set to the directory that
  11. #  the MPW Shell is reporting errors from.
  12. #
  13. #  Steps:
  14. #      1) Add the line:
  15. #            ':Macros:NextMPWError'
  16. #         to the Preditor.startup file (or your own startup file)
  17. #         OR execute the macro by typing:
  18. #            "NextMPWError()" <cr>
  19. #     2) Compile you program with MPW - let it spit out some error messages
  20. #     3) SAVE the Worksheet file
  21. #     4) Run or switch to Preditor
  22. #     5) Execute the macro "Next MPW Error" from the Macro menu (or use the
  23. #         key assignment - the default is command-option-M).
  24. #     6) Preditor will open the Worksheet file, locate the first error
  25. #        message, open the file and scroll to the correct line #
  26. #     7) Repeatedly run "Next MPW Error" error to "goto" the next error
  27. #     8) CLOSE the Worksheet before recompiling - and re-running the macro
  28. #
  29. #  This script works only with MPW 3.X and if you are using the MPW build
  30. #  scripts that produce a unique message, shown below.  You can replace this
  31. #  unique message with something else if you are compiling in another fashion.
  32. #
  33. #  © Copyright Evatac Software  1988-1991
  34. #  All rights reserved
  35. #
  36.  
  37. AddMenu "Next MPW Error" 46 10        # Assign to option-shift-M
  38.  
  39.     uniqueString = "----- Build of"
  40.     mpwPath = "MPW:Worksheet"
  41.     
  42.     continuing = 0
  43.     
  44.     For (name, ~Windows)
  45.         If (name == "Worksheet")
  46.             continuing = 1
  47.             break
  48.         End
  49.     End
  50.     
  51.     If (continuing == 0)
  52.         Open(mpwPath, "r")
  53.         Hide("", "Worksheet")    # We don't need to see the worksheet
  54.         Select(∞, "Worksheet")
  55.         Search("b", uniqueString, NULL, "Worksheet")
  56.     End
  57.  
  58.     Search("cp", "^[ \\t]*File ", NULL, "Worksheet")
  59.     Select(«0:[»1]≤1, "Worksheet")
  60.     ShowLine("Worksheet")
  61.  
  62. EndMenu
  63.